//
//  publicViewController.m
//  ILiangCang
//
//  Created by ZX on 16-4-13.
//  Copyright (c) 2016年 CRQ. All rights reserved.
//

#import "publicViewController.h"
#import "shopMainView.h"
#import "shopTopicView.h"
#import "shopGiftView.h"
#import "shopClassView.h"
#import "shopBrandView.h"
#import "dataModel.h"
#import "topicWebViewController.h"
@interface publicViewController ()<topicViewDelegate>

@end
@implementation publicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    switch (self.index)
    {
        case 0:
        {
            shopClassView * classView = [[shopClassView alloc]initWithFrame:self.view.frame];
            [self.view addSubview:classView];
        }
            break;
        case 1:
        {
            shopBrandView * brandVIew = [[shopBrandView alloc]initWithFrame:self.view.frame];
            [self.view addSubview:brandVIew];
        }
            break;
        case 2:
        {
            shopMainView * mainView = [[shopMainView alloc]initWithFrame:self.view.frame];
            [self.view addSubview:mainView];
         
        }
            break;
        case 3:
        {
            shopTopicView * topicView = [[shopTopicView alloc]initWithFrame:self.view.frame];
            topicView.delegate = self;
            [self.view addSubview:topicView];
        }
            break;
        case 4:
        {
            shopGiftView * giftView = [[shopGiftView alloc]initWithFrame:self.view.frame];
            [self.view addSubview:giftView];
        }
            break;
            
        default:
            break;
    }
    
    
}


#pragma --------topicView 代理方法
-(void)topicCellDidSelectedRow:(NSInteger)row with:(NSArray *)topicArray
{
    topicWebViewController * vc = [[topicWebViewController alloc]init];
    dataModel * data = topicArray[row];
    vc.url = data.topicURL;
    [self.navigationController pushViewController:vc animated:YES];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
